﻿
using NHibernate.Linq;
using SharpArch.Data.NHibernate;

namespace Magalie.Web.MagServices
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Web.Ria;
    using System.Web.Ria.Data;
    using System.Web.DomainServices;
    using System.Data;
    using System.Web.DomainServices.LinqToEntities;
    using Magalie.Web;
    using Magalie.Web.Classes;
    using Magalie.Domaine;


    // Implements application logic using the AdventureWorksEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    [EnableClientAccess()]
    public class OrganisationsService : NHibernateDomainService
    {
        public IQueryable<Organisation> GetOrganisations()
        {
            return NHibernateSession.Current.Linq<Organisation>();
        }        

        public void InsertProjet(Organisation org)
        {
            NHibernateSession.Current.Save(org);
        }

        public void UpdateProjet(Organisation projet)
        {
            NHibernateSession.Current.Update(projet);
        }

        public void DeleteEmployee(Organisation projet)
        {
            NHibernateSession.Current.Delete(projet);
        }
    }
}


